/*
 * @Description: 路由文件
 * @Author: 梁晓雨
 * @Date: 2025-01-23 00:22:59
 */
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import BlogHomePage from "@/views/BlogHomePage/BlogHomePage.vue";
import BlogMainPage from "../views/BlogHomePage/BlogMainPage/BlogMainPage.vue";
import BlogAttentionList from "../views/BlogHomePage/BlogAttentionList/BlogAttentionList.vue";
import BlogFansList from "../views/BlogHomePage/BlogFansList/BlogFansList.vue";
import BlogCreatePost from "../views/BlogHomePage/BlogCreatePost/BlogCreatePost.vue";
import BlogGeneralSetting from "../views/BlogHomePage/BlogGeneralSetting/BlogGeneralSetting.vue";
import SettingAcctountPassword from "../views/BlogHomePage/BlogGeneralSetting/SettingAcctountPassword/SettingAcctountPassword.vue";
import SettingLabelDirectory from "../views/BlogHomePage/BlogGeneralSetting/SettingLabelDirectory/SettingLabelDirectory.vue";
import BlogMainDetail from "../views/BlogHomePage/BlogMainPage/BlogMainDetail/BlogMainDetail.vue";
import BlogMainDetailEdit from "../views/BlogHomePage/BlogMainPage/BlogMainDetailEdit/BlogMainDetailEdit.vue";
import BlogRecommedPage from "../views/BlogHomePage/BlogRecommedPage/BlogRecommedPage.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    // 路由级别的代码分割
    // 这会为该路由生成一个单独的代码块 (about.[hash].js)
    // 当访问该路由时，该代码块会被按需加载。
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/blogHomePage',
    name: 'blogHomePage',
    component: BlogHomePage,
    children: [
      {
        path: '',
        component: BlogMainPage,
        children: [
          // {path: '/blogMainDetail',name:'blogMainDetail', component: BlogMainDetail },  // 博客详情页面

        ]
      },  // 默认子页面
      { path: '/blogMainDetail', name: 'blogMainDetail', component: BlogMainDetail },  // 博客详情页面
      { path: '/blogMainDetailEdit', name: 'blogMainDetailEdit', component: BlogMainDetailEdit },
      // { path:'/' }
      // { path: '/blogFriendList', name:'blogFriendList', component: BlogFriendList },  // 好友列表
      { path: '/blogAttentionList', name: 'blogAttentionList', component: BlogAttentionList },  // 关注列表
      { path: '/blogFansList', name: 'blogFansList', component: BlogFansList }, // 粉丝列表
      { path: '/blogCreatePost', name: 'blogCreatePost', component: BlogCreatePost },  // 创建博文
      {
        path: '/blogGeneralSetting',
        component: BlogGeneralSetting,
        children: [
          { path: '', component: SettingAcctountPassword }, // 默认切入页是账户和密码
          { path: '/SettingAcctountPassword', name: 'SettingAcctountPassword', component: SettingAcctountPassword },  // 账户和密码页面
          { path: '/SettingLabelDirectory', name: 'SettingLabelDirectory', component: SettingLabelDirectory },  // 标签和目录页面
        ]
      },  // 通用设置
      {
        path: '/blogRecommedPage', name: 'BlogRecommedPage', component: BlogRecommedPage
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router;
